﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DataAccess;
using Model;

namespace Business.WEB
{
    public static class SubjectConfirmationManager
    {
        public static Inscription NewInscription(int ciEstudiante, long codMateria, string gestion)
        {
            Inscription inscription = new Inscription()
            {
                ciEstudiante = ciEstudiante,
                codM = codMateria,
                Gestion = gestion
            };
            return InscriptionDataAccess.NewInscription(inscription);
        }
        public static bool CanITakeSubject(int studentId, long codMateria)
        {
            Collection<long> subjectsList = InscriptionDataAccess.GetMySubjects(studentId);
            for (int i = 0; i < subjectsList.Count; ++i)
            {
                if (subjectsList[i] == codMateria)
                    return false;
            }
            return true;
        }
    }
}
